perm filename PROB3.PUB[LSP,JRA]1 blob sn#084469 filedate 1974-01-28 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.BEGIN CENTERITTABIT2(10,23)SELECT 1
C00003 ENDMK
C⊗;
.BEGIN CENTERIT;TABIT2(10,23);SELECT 1;
I  Use the following definition:
.GROUP;

%3
\  twist[s] <=\[atom[s] → s;
\\ T → cons[twist[cdr[s]];twist[car[s]]]]
%1

and evaluate: 
%21.%3 twist[A]   %22.%3 twist[(A . B)]   %23.%3 twist[((A . B). C)]
.APART
.GROUP

%1
Now try:
%3
\findem[x;y] <=\[atom[x] → [eq[x;y] → T; T → NIL];
\\ T → cons[findem[car[x];y];findem[cdr[x];y]]]
%1

and evaluate:
%21.%3 findem[(A . B);A]   %22.%3 findem[(B .(A . C));A]
%23.%3 findem[(B .(A . C));C]   %24.%3 findem[(A . B);(A . B)]
.APART

.END